import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 商家信息分页查询
 * @param {查询条件} data
 */
export function listLayCompany(query) {
  return request({
    url: 'business/LayCompany/list',
    method: 'get',
    params: query,
  })
}

/**
 * 新增商家信息
 * @param data
 */
export function addLayCompany(data) {
  return request({
    url: 'business/LayCompany',
    method: 'post',
    data: data,
  })
}
/**
 * 修改商家信息
 * @param data
 */
export function updateLayCompany(data) {
  return request({
    url: 'business/LayCompany',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取商家信息详情
 * @param {Id}
 */
export function getLayCompany(id) {
  return request({
    url: 'business/LayCompany/' + id,
    method: 'get'
  })
}

/**
 * 删除商家信息
 * @param {主键} pid
 */
export function delLayCompany(pid) {
  return request({
    url: 'business/LayCompany/delete/' + pid,
    method: 'POST'
  })
}
// 导出商家信息
export async function exportLayCompany(query) {
  await downFile('business/LayCompany/export', { ...query })
}
